import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/home",
    name: "HomePage",
    component: () => import("@/pages/home-page/index.vue"),
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/pages/index-page/index.vue"),
      },
      {
        path: "identity",
        name: "identity-card",
        component: () => import("@/pages/identity-card/index.vue"),
      },
      {
        path: "message-notification",
        name: "messageNotification",
        component: () => import("@/pages/message-notification/index.vue"),
      },
      {
        path: "settings",
        name: "user-settings",
        component: () => import("@/pages/user-settings/index.vue"),
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/pages/login-page/index.vue"),
  },
  {
    path: "/add-pets",
    name: "addPets",
    component: () => import("@/pages/add-pets/index.vue"),
  },
  {
    path: "/my-pets",
    name: "myPets",
    component: () => import("@/pages/my-pets/index.vue"),
  },
  {
    path: "/contact-list",
    name: "contactList",
    component: () => import("@/pages/contact-list/index.vue"),
  },
  {
    path: "/adopt-publish",
    name: "adoptPublish",
    component: () => import("@/pages/adopt-publish/index.vue"),
  },
  {
    path: "/adopt-list",
    name: "adoptList",
    component: () => import("@/pages/adopt-list/index.vue"),
  },
  {
    path: "/adopt-detail",
    name: "adoptDetail",
    component: () => import("@/pages/adopt-detail/index.vue"),
  },
  {
    path: "/color-list",
    name: "colorList",
    component: () => import("@/pages/color-list/index.vue"),
  },
  {
    path: "/sign-in",
    name: "signIn",
    component: () => import("@/pages/sign-in/index.vue"),
  },
  {
    path: "/pets-qa",
    name: "petsQuestionAnswer",
    component: () => import("@/pages/pets-question-answer/index.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
